using Microsoft.VisualBasic.CompilerServices;
using SJVars;
using SJXmlP.XMLClasses;
using System;
using System.Reflection;
using System.Text;

namespace yW5Lib
{
	public class clsLocation : clsBase
	{
		public bool AddedToProject;

		private int mvarSceneCount;

		public const string ObjectName = "Location";

		public int SceneCount
		{
			get
			{
				return mvarSceneCount;
			}
			set
			{
				mvarSceneCount = value;
			}
		}

		public void Clear()
		{
			BaseClear();
		}

		public string DataAsXML()
		{
			string result = "";
			try
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.AppendLine("\t<LOCATION>");
				stringBuilder.Append(BaseDataAsXML());
				stringBuilder.AppendLine("\t</LOCATION>");
				result = stringBuilder.ToString();
				return result;
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
				return result;
			}
		}

		public bool CreateFromXML(string XMLData)
		{
			bool result = false;
			try
			{
				Clear();
				result = BaseCreateFromXML(XMLData);
				return result;
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
				return result;
			}
		}
	}
}
